package cn.ld.fj.util;


import net.esoar.modules.orm.PropertyFilter;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class RequestParamterUtil {

    public static List<PropertyFilter> getParamter(HttpServletRequest request) {
        List<PropertyFilter> propertyFilterList=new ArrayList<>();
        Map<String,String[]> paramMap=request.getParameterMap();
        for (String key: paramMap.keySet()){
            if (key.split("_")[0].equals("filter")) {
                String value = String.valueOf(paramMap.get(key)[0]);
                PropertyFilter propertyFilter = new PropertyFilter(key.substring(7), value);
//            propertyFilter.
                propertyFilterList.add(propertyFilter);
            }
        }
        return propertyFilterList;
    }



}
